package com.probox.common.entity.domain.platfom.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.probox.common.entity.domain.platfom.PlatformTemplateUrl;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * select结构实体类
 *
 *
 */
@ApiModel(value = "页面跳转")
public class OptionsSelect implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点value */
    private Long value;

    /** 节点名称 */
    private String label;
    /**
     * 路径
     */
    @ApiModelProperty(value = "url")
    private String url;
    /**
     *跳转类型
     */
    @ApiModelProperty(value = "跳转类型")
    private String jumpType;
    @ApiModelProperty(value = "跳转标识(商品分类页面/category,商品详情页面/productDetail,活动列表页面/acitivty,抽奖页面/luckDraw,客服页面customerService     " +
            "商品列表页面/productList,资讯公告页面/information,vip会员页面/vip,供应商申请页面/supplier,自定义链接页面/custom)")
    private String jumpSign;
    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<OptionsSelect> children;

    public OptionsSelect()
    {

    }

    public OptionsSelect(PlatformTemplateUrl platformTemplateUrl)
    {
        this.value = platformTemplateUrl.getUrlUid();
        this.label = platformTemplateUrl.getUrlValue();
        this.url = platformTemplateUrl.getUrlAddress();
        this.jumpType = platformTemplateUrl.getJumpType();
        this.jumpSign = platformTemplateUrl.getJumpSign();
        this.children = platformTemplateUrl.getChildren().stream().map(OptionsSelect::new).collect(Collectors.toList());
    }


    public Long getValue() {
        return value;
    }

    public void setValue(Long value) {
        this.value = value;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<OptionsSelect> getChildren()
    {
        return children;
    }

    public void setChildren(List<OptionsSelect> children)
    {
        this.children = children;
    }

    public String getJumpType() {
        return jumpType;
    }

    public void setJumpType(String jumpType) {
        this.jumpType = jumpType;
    }

    public String getJumpSign() {
        return jumpSign;
    }

    public void setJumpSign(String jumpSign) {
        this.jumpSign = jumpSign;
    }
}
